package com.qhgrain.api.menurolepermission.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.pubframework.springmybatis.dao.IMysqlBaseMapper;
import com.qhgrain.api.menurolepermission.entity.Permission;
import com.qhgrain.api.menurolepermission.info.PermissionInfo;

public interface PermissionMapper extends IMysqlBaseMapper<Permission>{

	List<PermissionInfo> queryPage(@Param("id")String id,@Param("name") String name, 
			@Param("type")String type,
			@Param("menuName")String menuName,@Param("appId") String appId,
			@Param("startIndex")int startIndex,@Param("pageSize") int pageSize);
	
	int queryPageCount(@Param("id")String id,@Param("name") String name, 
			@Param("type")String type,
			@Param("menuName")String menuName,@Param("appId") String appId);
	
	PermissionInfo findInfoById(@Param("permissionId")String permissionId);
	
	List<PermissionInfo> queryByUserApp(@Param("userId") String userId,@Param("appId") String appId,@Param("permissionType") String permissionType);
	
	List<PermissionInfo> queryByRoleApp(@Param("roleId")String roleId, @Param("appId") String appId,@Param("permissionType") String permissionType);
}
